<% @errors = {} if @errors == nil %> 
<%= render :partial=>'setup_menu', :locals => { :mode => @mode } %>

<div id="form">
  <form action="<%= url_for :controller => 'admin', :action => 'setup' %>" class="uniForm" method="post" > 
          
    <fieldset> 
      <h3>Administrative Account Setup</h3> 
      
      <%= form_text( { :label => 'Admin User Name', 
                       :name => 'user[username]',
                       :required => true,
                       :value => @user != nil ? @user.username : '', 
                       :errorText => @errors['username'] 
                     } ) %>
                    
      <%= form_text( { :label => 'Admin Email Address', 
                       :name => 'user[email]', 
                       :required => true,
                       :value => @user != nil ? @user.email    : '',
                       :errorText => @errors['email'], 
                       :valClass => 'validateEmail'
                     } ) %>
      <%= form_text( { :label => 'Password',
                       :name => 'user[new_password]',
                       :required => true,
                       :errorText => @errors['new_password'] 
                     } ) %>
      <%= form_text( { :label => 'Verify Password', 
                       :name => 'user[new_password_confirmation]', 
                       :required => true, 
                       :errorText => @errors['new_password_confirmation'], 
                       :valClass => 'validateSameAs user[new_password]' 
                     } ) %>     
      
      <input name="mode" id="mode" value="admin" type="hidden" />

    </fieldset> 
    
    <div class="buttonHolder"> 
      <button type="submit" class="secondaryAction">← Cancel and go back</button> 
      <button type="submit" class="primaryAction">Submit</button> 
    </div> 
  </form> 
</div>

<script> 
  $(function(){
    $('form.uniForm').uniform({
      prevent_submit : true
    });
  });
</script>  
          